// townscript for town 11: Senarti fort.

begintownscript;

variables;

int choice;

body;

beginstate INIT_STATE;
	
	if (get_flag(11,0) == 1) {
			set_terrain(36,19,218);
			}
		
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

	if (get_flag(11,11) == 1)
			end();
		message_dialog("You can already see from the walls that Senarti society is a highly evolved one. Not every race paints so beautifully. You'd better look out. They look quite civilised.","");
		set_flag(11,11,1);

break;

beginstate 10;
if (get_flag(11,0) == 0) {
	if (get_flag(1,6) == 1) { // You got Flanigan's quest
			reset_dialog();
			add_dialog_str(0,"This book looks important. You remember Flanagan. This is probably his book!",0);
			add_dialog_choice(0,"Don't touch it.");
			add_dialog_choice(1,"Take it.");
			choice = run_dialog(1);
			
			if (choice == 1)
					end();
			
			if (choice == 2) {
					message_dialog("You take the book off the pedestal and suddenly hear a loud ring throughout the whole cave. You hear shouting from behind the door.","It seems as if you triggered some magical trap.");
					set_flag(11,0,1);				
					change_spec_item(2,1);
					set_terrain(36,19,218);
					activate_hidden_group(1);
					end();
					}
			}

		reset_dialog(); // You didn't get Flanagan's quest (a minor message change)
		add_dialog_str(0,"This seems like an old spell book. It has been put on a beautiful carved pillar. A red light is radiating from under the book. Would you want to take it?",0);
		add_dialog_choice(0,"Don't touch it.");
		add_dialog_choice(1,"Take it.");
		choice = run_dialog(1);
	
		if (choice == 1)
				end();
			
		if (choice == 2) {
				message_dialog("You take the book off the pedestal and suddenly hear a loud ring throughout the whole cave. You hear shouting from behind the door.","It seems as if you triggered some magical trap.");
				set_flag(11,0,1);				
				change_spec_item(2,1);
				set_terrain(36,19,218);
				activate_hidden_group(1);
				}
		}
break;

beginstate 11;
break;

//beginstate 12;
//if (get_flag(11,3) == 0) {
//		if (species_in_party(2) == 1) {
//				reset_dialog();
//				add_dialog_str(0,"This is something you hadn't foreseen. You have a Nephil in your party, who just found a button, covered under stones. You press the button. You hear a sound made by stone sliding on stone.",0);
//				add_dialog_str(1,"Having a Nephil in your party is extremely handy in this place. Because the Senarti are cats, like Nephilim, you a major advantage. Your Nephil party member can find things your other party members can't.",0);
//				add_dialog_choice(0,"Okay");
//				choice = run_dialog(1);
//				set_terrain(14,13,0);
//				set_terrain(13,13,0);
//				set_flag(11,3,1);
//				end();
//				}
//			
//			// You don't need to find the note anymore to find the button, but if you find the note first, show this message:
//			if (get_flag(11,10) == 1) {
//					message_dialog("You found the button the note was written about! You press it. You hear stone sliding over stone, and look around. The sound seemed to have come from the west.","");
//					set_terrain(14,13,0);
//					set_terrain(13,13,0);
//					set_flag(11,3,1);
//					end();
//					}
//				
//				// If you didn't find the note, but have enough luck, you can find the button, find it:
//				if (get_char_skill_pts(0) + get_char_skill_pts(1) + get_char_skill_pts(2) + get_char_skill_pts(3) >= 5) {
//						message_dialog("You step on this patch, filled with rocks and rumble, and you slip. You fall down, thrusting some rocks to the side with your feet.","When you stand up to see what made you slip, you find a button, buried under the rocks. You also pressed it down while slipping.");
//						set_terrain(14,13,0);
//						set_terrain(13,13,0);
//						set_flag(11,3,1);
//						end();
//						}
//		}
//break;

beginstate 13;
	reset_dialog();
	add_dialog_str(0,"You stand in front of a narrow tunnel entrance. God knows where it will lead you. However, this could be a very profitable thing to do.",0);
	add_dialog_str(1,"You could enter this tunnel and see where it ends. Do you?",0);
	add_dialog_choice(0,"Enter it");
	add_dialog_choice(1,"Leave it");
	choice = run_dialog(0);

	if (choice == 1) {
		message_dialog("You emerge in a small cave. On your left hand side, somebody made a small building. Judging by the elaborate drawings surrounding the door, you guess the Senarti made this.","");
		change_outdoor_location(4,1,6,40);
		move_to_new_town(19,3,19);
		}
break;

beginstate 14;
if (get_flag(11,7) == 1)
		end();
	message_dialog("You enter the fort, and are amazed by what you see. This is very unlike the Nephil architecture you know of. A pond in the middle of the cave, all buildings neatly constructed with marble have blue stripes painted on them.","What you suspected earlier upon entering this fort has been proved true. They are indeed a high evolved society. Getting to the core of this menace may be a bigger problem then you thought.");
	set_flag(11,7,1);
break;

beginstate 15;
if (get_flag(11,8) == 1)
		end();
	message_dialog("The small inn here, is neatly decorated with all kinds of small paintings of cat figures running after some sort of big thing. You wonder what it is.","");
	set_flag(11,8,1);
break;

beginstate 16;
if (get_flag(11,12) == 1)
		end();
	message_dialog("You are amazed to hear (and smell) rats in this narrow tunnel. You had thought that in a place where cats live, no rat would survive.","");
	set_flag(11,12,1);
break;

beginstate 17;
	message_dialog("You walk past this bookshelf. It doesn't look very abnormal, if only that piece of paper on the top shelf wouldn't look so old and wrinkled. You take it, and look at it.","You fold it open, and it appears to be a map: the Senarti fort seems to be connected to tunnels and caverns underground by some sort of tunnel.");
	set_flag(11,10,1); // different message at tunnel entrance
break;

beginstate 18;
if (get_flag(11,13) == 0) {
		message_dialog("This room is nicer than others room you have seen so far. In the room you see a big Nephil. His armour is quite beautiful. What gets your attention, however, is a small symbol painted on it.","");
		set_flag(11,13,1);
		}
break;

beginstate 19;
if (get_flag(11,14) == 0) {
		message_dialog("This room houses quite some bookshelves, filled with all kinds of scrolls. Sitting on a chair, looking at you with startled, but enraged eyes, is a Senarti mage. He looks bigger than the others, and he might be more powerfull.","You spot a small, painted symbol on his robe.");
		set_flag(11,14,1);
		}
break;